package com.admin.service.impl;

import com.admin.entity.Province;
import com.admin.mapper.ProvinceMapper;
import com.admin.service.IProvinceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author marisheng
 * @since 2019-11-21
 */
@SuppressWarnings("ALL")
@Service
public class ProvinceServiceImpl extends ServiceImpl<ProvinceMapper, Province> implements IProvinceService {
    @Autowired
    private ProvinceMapper provinceMapper;

    /**
     * 根据id查找省的名字
     * @param
     * @return
     */
    @Override
    public Province selectProvince(int provincecode) {
        QueryWrapper q=new QueryWrapper();
        q.eq("provinceCode",provincecode);
        Province p=provinceMapper.selectOne(q);
        return p;
    }

}
